<?php if(isset($error)) echo '<script type="text/javascript">alert("'.$error.'");</script>';?>
<div class="portlet-body">
	<table class="table table-striped table-bordered" id="sample_1">
		<thead>
			<tr>
				<th style="width:8px;"><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes" /></th>
				<?php 
				foreach ($fields as $field){
					if($field_attr[$field]!='hidden')
						echo "<th>".$column[$field]."</td>";
				}
				?>				
				<th></th>
			</tr>
		</thead>
		<tbody>
		<?php 
		foreach ($records as $record){
			echo "
			<tr class=\"odd gradeX\">
				<td><input type=\"checkbox\" class=\"checkboxes\" value=\"1\" /></td>";
				foreach ($fields as $field){
					if($field_attr[$field]!='hidden'){
						echo "<td class='".$record_style[$field]."'>".$record->$field."</td>";
					}
				}
			echo "<td>";
			if($update_btn) echo "<a href=\"".base_url().$action_edit."/".$record->$id."\" class=\"btn mini purple\"><i class=\"icon-edit\"></i> Edit</a>";
			echo "&nbsp;";
			if($delete_btn) echo "<a href=\"".base_url().$action_delete."/".$record->$id."\" class=\"btn mini black\" onclick=\"return confirm('Apakah anda yakin?')\" ><i class=\"icon-trash\"></i> Delete</a>";
			echo "</td></tr>";
		}
		?>
		</tbody>
	</table>
	<div class="form-actions">
		<form action="<?php echo base_url().$action_add;?>">
    		<button type="submit" class="btn blue">Add</button>
    	</form>
    </div>
</div>